<?php

class Friends_Plugin {

	function Friends_Plugin() {
		
	}

	function install($params) {
		$script = new Cts_Db_Script("friends", "install");
		if (!$script) {
			$params['errors'] = $script->errors;
		}
		return $params;
	}

	function uninstall($params) {
		$script = new Cts_Db_Script("friends", "uninstall");
		if (!$script) {
			$params['errors'] = $script->errors;
		}
		return $params;
	}

	function enable($params) {
		return $params;
	}

	function disable($params) {
		return $params;
	}

	function userDelete($params) {
		$friends_table = new FriendsFriends();
		$where = $friends_table->getAdapter()->quoteInto("username = ?", $params['username']);
		$friends_table->delete($where);
		return $params;
	}

}
